package com.example.shardingjdbctest.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.shardingjdbctest.entity.WlShardTestEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WlShardTestMapper extends BaseMapper<WlShardTestEntity> {
    @Select("select * from wl_shard_test order by cid desc")
    public List<WlShardTestEntity> getAll();

    @Insert("insert into wl_shard_test(cname,cstatus,user_id) values(#{cname},#{cstatus},#{userId}")
    public int insert(WlShardTestEntity entity);

    public void update(WlShardTestEntity entity);

    public void delete(Long id);

    public WlShardTestEntity getByName(String name);
}